<?php
/**
 * Created by JetBrains PhpStorm.
 * User: khathirdstep1025
 * Date: 9/26/12
 * Time: 10:18 PM
 * To change this template use File | Settings | File Templates.
 */

class News_model extends CI_Model{
    public function __construct(){
        $this->load->database();
    }

    public function get_news($slug = FALSE){
        if ($slug === FALSE){
            $query = $this->db->get('news');
            return $query->result_array();
        }

        $query = $this->db->get_where('news', array('slug' => $slug));
        return $query->row_array();
    }
}